package com.lancoo.answer.model.bean

import android.os.Parcelable
import com.drake.brv.item.ItemExpand
import kotlinx.android.parcel.Parcelize

@Parcelize
open class CompositionComment(
    val Comment: String,
    var EvalScore: Double,
    var FullScore: Double,
    val DetailComment: DetailComment
) : Parcelable

@Parcelize
data class DetailComment(
    var ScoreCats: MutableList<ScoreCat>,
    var Sentences: MutableList<Sentence>, //实际代码中用到
    val ScoreCatList: MutableList<ScoreCat>? = ArrayList(),
    val SentList: MutableList<Sentence>? = ArrayList()//考辅后台返回的
) : Parcelable

@Parcelize
data class ScoreCat(
    val Name: String,
    val ScoreRate: Double
) : Parcelable

@Parcelize
data class Sentence(
    var Index: Int,
    var Comment: MutableList<Comment>? = ArrayList(),
    var SntOri: String,
    val SentOri: String, //兼容考辅
    var SentList: MutableList<Comment>? = ArrayList() //兼容考辅
) : ItemExpand, Parcelable {

    //    override val childNode: MutableList<BaseNode>?
//        get() {
//            val firstNode = mutableListOf<BaseNode>()
//            firstNode.addAll(SentList)
//            return firstNode
//        }
//    override val itemType: Int
//        get() = 0
    override var itemExpand: Boolean = Index == 0

    override var itemGroupPosition: Int = 0
    override var itemSublist: List<Any?>?
        get() = Comment?.toList()
        set(value) {Comment=value as MutableList<Comment>}

//    override var itemSublist: List<Any?>? = SentList.toList()

}

@Parcelize
data class Comment(
    val Cat: String,
    val Msg: String,
    val Type: String
) : Parcelable {
//    override val childNode: MutableList<BaseNode>?
//        get() = null
//    override val itemType: Int
//        get() = 1
}

